# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=userpath
pkgname=python-$_pkgname
pkgver=1.8.0
pkgrel=2
pkgdesc='Cross-platform tool for adding locations to the user PATH, no elevated privileges required!'
arch=('any')
url='https://github.com/ofek/userpath'
license=('MIT')
depends=('python' 'python-click' 'python-distro')
makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-wheel')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('d2f082909fad22cf5b33f175afdeebe14a44ebd245c84506395f01a288eccf9c376ac28dcc4b618cc2464e1a23e740b41f4f4ad0e780a42e1185c5283ccc7330')

build() {
  cd $_pkgname-$pkgver

  python -m build -nw
}

check() {
  cd $_pkgname-$pkgver

  python -m pytest
}

package() {
  cd $_pkgname-$pkgver

  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-MIT
}

# vim:set ts=2 sw=2 et:
